package com.xdf.xzymanagementsystem.service.impl;

import com.xdf.xzymanagementsystem.util.Example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.xdf.xzymanagementsystem.entity.JcStore;

import java.util.List;

import com.xdf.xzymanagementsystem.dao.JcStoreMapper;
import com.xdf.xzymanagementsystem.service.JcStoreService;

/**
 * @Description : com.xdf.xzymanagementsystem.service.impl(业务层实现类,该类为生成器自动生成).
 * @Author : 张柯
 * @Date : 2021-01-09 17:05:38
 */
@Service
public class JcStoreServiceImpl implements JcStoreService {
    @Autowired
    private JcStoreMapper dao;

    /**
     * @Describe 新增方法
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insert(JcStore record) throws Exception {
        return dao.insert(record);
    }

    /**
     * @Describe 选择新增
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSelective(JcStore record) throws Exception {
        return dao.insertSelective(record);
    }

    /**
     * @Describe 批量新增
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int multiInsert(List<JcStore> list) throws Exception {
        return dao.multiInsert(list);
    }

    /**
     * @Describe 修改
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKey(JcStore record) throws Exception {
        return dao.updateByPrimaryKey(record);
    }

    /**
     * @Describe 选择修改
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKeySelective(JcStore record) throws Exception {
        return dao.updateByPrimaryKeySelective(record);
    }

    /**
     * @Describe 修改
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int update(JcStore record) throws Exception {
        return dao.updateByPrimaryKey(record);
    }

    /**
     * @Describe 批量修改
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int multiUpdate(List<JcStore> list) throws Exception {
        return dao.multiUpdate(list);
    }

    /**
     * @Describe 根据主键查询
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    public JcStore selectByPrimaryKey(String id) throws Exception {
        return dao.selectByPrimaryKey(id);
    }

    /**
     * @Describe 根据主键删除
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteByPrimaryKey(String id) throws Exception {
        return dao.deleteByPrimaryKey(id);
    }

    /**
     * @Describe 根据Entity查询
     * @author 张柯
     * @Date 2021-01-09 17:05:38
     */
    @Override
    public List<JcStore> listQuery(JcStore record) throws Exception {
        return dao.selectByParam(record);
    }

    /**
     * 查询
     *
     * @param example
     * @return
     * @throws Exception
     */
    @Override
    public List<JcStore> listQuery(Example example) throws Exception {
        return dao.selectByExample(example);
    }

    /**
     * 计数
     * @param example
     * @return
     */
    @Override
    public Long count(Example example) {
        return dao.countByExample(example);
    }

    @Override
    public List<JcStore> getAllStoreMaterial(){
        return dao.getAllStoreMaterial();
    }
}